<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>木毛旅行社 - 首页</title>
	<style>
		:root {
			--primary-color: #3498db;
			--secondary-color: #2980b9;
			--accent-color: #e74c3c;
			--light-bg: #f8f9fa;
			--dark-bg: #2c3e50;
			--text-color: #333;
			--light-text: #fff;
			--border-radius: 8px;
			--box-shadow: 0 4px 12px rgba(0,0,0,0.1);
			--transition: all 0.3s ease;
		}

		* {
			margin: 0;
			padding: 0;
			box-sizing: border-box;
		}

		body {
			font-family: 'Helvetica Neue', Arial, sans-serif;
			color: var(--text-color);
			line-height: 1.6;
			background-color: var(--light-bg);
		}

		header {
			background-color: var(--light-text);
			box-shadow: var(--box-shadow);
			position: sticky;
			top: 0;
			z-index: 100;
		}

		.center {
			width: 90%;
			max-width: 1200px;
			margin: 0 auto;
			padding: 0 15px;
		}

		.logo {
			color: var(--dark-bg);
			font-size: 2rem;
			margin: 0.5em 0;
			text-align: center;
		}

		nav ul.link {
			display: flex;
			justify-content: center;
			flex-wrap: wrap;
			gap: 1.5em;
			list-style: none;
			padding: 1em 0;
		}

		nav ul.link li a {
			color: var(--text-color);
			text-decoration: none;
			font-weight: 500;
			padding: 0.5em 1em;
			border-radius: var(--border-radius);
			transition: var(--transition);
		}

		nav ul.link li a:hover,
		nav ul.link li.active a {
			color: var(--light-text);
			background-color: var(--primary-color);
		}

		#search {
			background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
			url('static/image/hero-bg.jpg') center/cover no-repeat;
			height: 400px;
			display: flex;
			align-items: center;
			justify-content: center;
			position: relative;
		}

		#search form {
			display: flex;
			max-width: 800px;
			width: 100%;
			margin: 0 auto;
		}

		.search {
			flex: 1;
			padding: 15px 20px;
			border: none;
			border-radius: var(--border-radius) 0 0 var(--border-radius);
			font-size: 1.1rem;
		}

		.button {
			padding: 0 30px;
			background-color: var(--primary-color);
			color: white;
			border: none;
			border-radius: 0 var(--border-radius) var(--border-radius) 0;
			font-size: 1.1rem;
			cursor: pointer;
			transition: var(--transition);
		}

		.button:hover {
			background-color: var(--secondary-color);
		}

		#containter {
			display: grid;
			grid-template-columns: 250px 1fr;
			gap: 30px;
			padding: 30px 0;
		}

		.sidebar {
			display: flex;
			flex-direction: column;
			gap: 30px;
		}

		.sidebox {
			background: white;
			border-radius: var(--border-radius);
			padding: 20px;
			box-shadow: var(--box-shadow);
		}

		.sidebox h2 {
			font-size: 1.3rem;
			margin-bottom: 15px;
			color: var(--dark-bg);
			border-bottom: 2px solid var(--primary-color);
			padding-bottom: 8px;
		}

		.tag ul {
			display: flex;
			flex-wrap: wrap;
			gap: 10px;
			list-style: none;
		}

		.tag ul li a {
			display: block;
			padding: 5px 15px;
			background-color: var(--light-bg);
			border-radius: 20px;
			text-decoration: none;
			color: var(--text-color);
			font-size: 0.9rem;
			transition: var(--transition);
		}

		.tag ul li a:hover {
			background-color: var(--primary-color);
			color: white;
		}

		.hot figure {
			margin-bottom: 15px;
			transition: var(--transition);
		}

		.hot figure:hover {
			transform: translateY(-5px);
		}

		.hot img {
			width: 100%;
			height: 120px;
			object-fit: cover;
			border-radius: var(--border-radius);
			margin-bottom: 5px;
		}

		.hot figcaption {
			font-size: 0.9rem;
			text-align: center;
		}

		.tourBox {
			display: grid;
			grid-template-columns: 1fr 1fr;
			gap: 10px;
		}

		.tourBox a {
			display: flex;
			align-items: center;
			justify-content: center;
			height: 80px;
			background-color: var(--light-bg);
			border-radius: var(--border-radius);
			text-decoration: none;
			color: var(--text-color);
			font-weight: 500;
			transition: var(--transition);
			text-align: center;
			padding: 0 10px;
		}

		.tourBox a:hover {
			background-color: var(--primary-color);
			color: white;
		}

		/* 修改列表部分为grid布局 */
		.list {
			display: grid;
			grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
			gap: 20px;
		}

		.infor {
			grid-column: 1 / -1;
			display: flex;
			justify-content: space-between;
			background: white;
			padding: 15px 20px;
			border-radius: var(--border-radius);
			box-shadow: var(--box-shadow);
		}

		.infor ul {
			display: flex;
			gap: 20px;
			list-style: none;
		}

		.infor ul li a {
			text-decoration: none;
			color: var(--text-color);
			font-weight: 500;
			padding: 5px 10px;
			border-radius: var(--border-radius);
			transition: var(--transition);
		}

		.infor ul li a:hover,
		.infor ul li a.checked {
			background-color: var(--primary-color);
			color: white;
		}

		.list figure {
			background: white;
			border-radius: var(--border-radius);
			overflow: hidden;
			box-shadow: var(--box-shadow);
			transition: var(--transition);
			display: flex;
			flex-direction: column;
			height: 100%;
		}

		.list figure:hover {
			transform: translateY(-5px);
			box-shadow: 0 10px 20px rgba(0,0,0,0.15);
		}

		.content {
			width: 100%;
			height: 200px;
			object-fit: cover;
		}

		.list figcaption {
			padding: 20px;
			flex-grow: 1;
			display: flex;
			flex-direction: column;
		}

		.list figcaption h2 {
			font-size: 1.3rem;
			margin-bottom: 10px;
			color: var(--dark-bg);
		}

		.list figcaption mark {
			background: transparent;
			color: var(--accent-color);
			font-weight: bold;
		}

		.list figcaption ul {
			list-style: none;
			margin-bottom: 15px;
			flex-grow: 1;
		}

		.list figcaption ul li {
			margin-bottom: 8px;
		}

		.buy {
			text-align: right;
			margin-top: auto;
		}

		.buy button {
			background-color: var(--primary-color);
			color: white;
			border: none;
			padding: 10px 20px;
			border-radius: var(--border-radius);
			cursor: pointer;
			font-size: 1rem;
			transition: var(--transition);
		}

		.buy button:hover {
			background-color: var(--secondary-color);
		}

		.buy a {
			color: white;
			text-decoration: none;
		}

		@media (max-width: 992px) {
			#containter {
				grid-template-columns: 1fr;
			}

			.sidebar {
				display: grid;
				grid-template-columns: repeat(2, 1fr);
				gap: 20px;
			}
		}

		@media (max-width: 768px) {
			nav ul.link {
				gap: 0.5em;
			}

			nav ul.link li a {
				padding: 0.5em;
				font-size: 0.9rem;
			}

			#search {
				height: 300px;
			}

			.sidebar {
				grid-template-columns: 1fr;
			}

			.infor {
				flex-direction: column;
				gap: 15px;
			}

			.infor ul {
				justify-content: center;
			}
		}

		@media (max-width: 480px) {
			.list {
				grid-template-columns: 1fr;
			}
		}
	</style>
</head>
<body>
<header id='header'>
	<div class='center'>
		<h1 class="logo">木毛旅行社</h1>
		<nav>
			<h2 class="none">网站导航</h2>
			<ul class="link">
				<li class="active"><a href="/index">首页</a></li>
				<li><a href="/information">旅行信息</a></li>
				<li><a href="/buy">订购</a></li>
				<li><a href="/scenery">风景欣赏</a></li>
				<li><a href="/tologin">登录</a></li>
			</ul>
		</nav>
	</div>
</header>

<div id="search">
	<form action="/WhereName" method="GET">
		<input type="text" name="cityName" class="search" placeholder="输入目的地、景点或关键词">
		<input id="Select" value="搜索" type="submit" class="button"/>
	</form>
</div>

<div id="containter" class="center">
	<aside class='sidebar'>
		<div class="sidebox recommend">
			<h2>景点推荐</h2>
			<div class="tag">
				<ul>
					<li><a href="#">上海</a></li>
					<li><a href="#">大理</a></li>
					<li><a href="#">北京</a></li>
					<li><a href="#">南昌</a></li>
					<li><a href="#">漓江</a></li>
					<li><a href="#">泰国</a></li>
					<li><a href="#">缅甸北部</a></li>
					<li><a href="#">拉萨</a></li>
					<li><a href="#">墨西哥</a></li>
				</ul>
			</div>
		</div>
		<div class="sidebox hot">
			<h2>热卖旅游</h2>
			<div>
				<figure>
					<img src="static/image/sidebar1.jpg" alt="巴厘岛1日游">
					<figcaption>巴厘岛1日游</figcaption>
				</figure>
				<figure>
					<img src="static/image/sidebar2.jpg" alt="马尔代夫3日游">
					<figcaption>马尔代夫3日游</figcaption>
				</figure>
				<figure>
					<img src="static/image/sidebar3.jpg" alt="普吉岛5日游">
					<figcaption>普吉岛5日游</figcaption>
				</figure>
			</div>
		</div>
		<div class="sidebox tourBox">
			<h2>旅游百宝箱</h2>
			<div>
				<a href="/buy" class="sky1">火车票查询</a>
				<a href="/buy" class="sky2">机票查询</a>
				<a href="/buy" class="sky3">动车查询</a>
				<a href="/buy" class="sky4">客车查询</a>
			</div>
		</div>
	</aside>

	<div class="list">
		<div class="infor">
			<ul class="left">
				<li><a href='#'>限时特价</a></li>
				<li><a href='#'>热门推荐</a></li>
			</ul>
			<ul class="right">
				<li><a href='#' class="checked">推荐</a></li>
				<li><a href='#'>折扣</a></li>
				<li><a href='#'>价格</a></li>
			</ul>
		</div>

		{{ range $value := .res }}
		<figure>
			<img class="content" src="{{ $value.Attractions_Images }}" alt="{{ $value.Attractions_Name }}">
			<figcaption>
				<h2>{{ $value.Attractions_Name }}</h2>
				<ul>
					<li><mark>优惠：</mark>{{ $value.Attractions_discounts }}</li>
					<li><mark>交通：</mark>{{ $value.Attraction_transportation }}</li>
					<li><mark>团期：</mark>{{ $value.Tour_period }}</li>
				</ul>
				<div class="buy">
					<button><a href="{{ $value.Button }}">点击查看</a></button>
				</div>
			</figcaption>
		</figure>
		{{ end }}
	</div>
</div>

<script>
	document.getElementById('search').addEventListener('mouseover', function() {
		this.style.background = 'linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url("static/image/border2(1).jpg") center/cover no-repeat';
	});

	document.getElementById('search').addEventListener('mouseout', function() {
		this.style.background = 'linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("static/image/border3.jpg") center/cover no-repeat';
	});

	document.getElementById('search').addEventListener('mouseout', function() {
		this.style.background = 'linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("static/image/border4.jpg") center/cover no-repeat';
	});

	document.getElementById('search').addEventListener('mouseout', function() {
		this.style.background = 'linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("static/image/border5.jpg") center/cover no-repeat';
	});

	document.getElementById('search').addEventListener('mouseout', function() {
		this.style.background = 'linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("static/image/border6.jpg") center/cover no-repeat';
	});
</script>
</body>
</html>